﻿<?php

/**
 * BbPlayers form.
 *
 * @package    vogue
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class BbPlayersForm extends BaseBbPlayersForm
{
  public function configure()
  {
      unset($this['born']);
    
	   	# WIDGETS
      $this->widgetSchema['first_name']       = new sfWidgetFormInputText(array(), array('style'=>'width:400px; height:15px;'));
      $this->widgetSchema['last_name']       = new sfWidgetFormInputText(array(), array('style'=>'width:400px; height:15px;'));
  	  $this->widgetSchema['nick']       = new sfWidgetFormInputText(array(), array('style'=>'width:400px; height:15px;'));
  	  $this->widgetSchema['about']       = new sfWidgetFormTextarea(array(), array('style'=>'width:400px; height:35px;'));
  	  $this->widgetSchema['position_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BbPositions'), 'add_empty' => true), array('style'=>'width:400px;height:24px;'));
      $this->widgetSchema['def_img']       = new sfWidgetFormInputFile(array(), array());
      $this->widgetSchema['team_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BbTeams'), 'add_empty' => true), array('style'=>'width:400px;height:24px;'));
      
      
      $this->widgetSchema['height']     = new sfWidgetFormInputText(array(), array('style'=>'width:200px; height:15px;'));
      $this->widgetSchema['weight']     = new sfWidgetFormInputText(array(), array('style'=>'width:200px; height:15px;'));
      $this->widgetSchema['education']  = new sfWidgetFormInputText(array(), array('style'=>'width:200px; height:15px;'));
      $this->widgetSchema['experience'] = new sfWidgetFormInputText(array(), array('style'=>'width:200px; height:15px;'));
      $this->widgetSchema['birthday']   = new sfWidgetFormInputText(array(), array('style'=>'width:200px; height:15px;'));
      $this->widgetSchema['birth_place']= new sfWidgetFormInputText(array(), array('style'=>'width:200px; height:15px;'));
      $this->widgetSchema['number']     = new sfWidgetFormInputText(array(), array('style'=>'width:200px; height:15px;'));
      
    	# VALIDATORS		
    	$required = 'Утга оруулна уу.';
    	$this->validatorSchema['first_name']       = new sfValidatorString(array(), array());
    	$this->validatorSchema['last_name']  	    = new sfValidatorPass();
    	$this->validatorSchema['nick']        = new sfValidatorPass();
	   	$this->validatorSchema['about']        = new sfValidatorPass();
	
  		$this->validatorSchema['def_img']       = new sfValidatorFile(	
                                                  array('required' => false,
                                                      'path'       => sfConfig::get("sf_upload_dir")."/player",
                                                      'max_size'   => 209715200,
                                                      'mime_types' =>  array('image/jpeg','image/pjpeg','image/png','image/x-png','image/gif',)),
                                                  array(
                                                      'max_size'   => 'Файлын хэмжээ хамгийн ихдээ 20MB байна',
                                                      'mime_types' => 'Дараах өргөтгөлтэй файлууд зөвшөөрөгдөнө: jpg, png, gif'));

      $this->widgetSchema->setHelp('def_img', 'x px - png | gif | jpg');
      
      $this->validatorSchema['number']        = new sfValidatorPass();
      $this->validatorSchema['height']        = new sfValidatorPass();
      $this->validatorSchema['weight']        = new sfValidatorPass();
      $this->validatorSchema['education']        = new sfValidatorPass();
      $this->validatorSchema['experience']        = new sfValidatorPass();
      $this->validatorSchema['birthday']        = new sfValidatorPass();
      $this->validatorSchema['birth_place']        = new sfValidatorPass();
      
      // LABELS      
      $this->widgetSchema->setLabel('first_name', 'Нэр');
      $this->widgetSchema->setLabel('last_name', 'Овог');
      $this->widgetSchema->setLabel('about', 'Тухай');
      $this->widgetSchema->setLabel('position_id', 'Байрлал');
      $this->widgetSchema->setLabel('def_img', 'Зураг');
      $this->widgetSchema->setLabel('team_id', 'Багийн Нэр');
      
      $this->widgetSchema->setLabel('number', 'Номер №');
      $this->widgetSchema->setLabel('height', 'Өндөр');
      $this->widgetSchema->setLabel('weight', 'Жин');
      $this->widgetSchema->setLabel('education', 'Боловсрол');
      $this->widgetSchema->setLabel('experience', 'Туршлага');
      $this->widgetSchema->setLabel('birthday', 'Төрсөн огноо');
      $this->widgetSchema->setLabel('birth_place', 'Төрсөн газар');
      
  }
}
